<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
  <meta name="format-detection" content="telephone=no">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>注册</title>
  <script>
      (function () {
          var setFont=function () {
              var calc_window_width=window.innerWidth>750?750:window.innerWidth;
              document.documentElement.style.fontSize=calc_window_width/7.5+'px';
          }
          setFont();
          window.onresize=function () {
              setFont();
          }
      })()
  </script>
  <link rel="stylesheet" href="css/icon.css">
  <link rel="stylesheet" href="css/weui.css">
  <link rel="stylesheet" href="css/jquery-weui.css">
  <link rel="stylesheet" href="css/style.css">
</head>
<body>
  <!-- 顶部部分 -->
  <!-- 头 -->
  <div class="weui-header bg_blue"> 
    <div class="weui-header-left">
      <a class="icon icon-109 f-white"></a>  
    </div>
    <h1 class="weui-header-title">注册</h1>
  </div>
  <section>
    <div class="bg-f5 space20"></div>
    <div class="register-box">
      <div class="register-alert">请输入手机号码</div>
      <p>注册即代表阅读并同意<span class="shiyongtiaokuan">使用条款</span>和<span class="yincangzhengce">隐藏政策</span></p>
    </div>
    <div class="ipt-box">
      <div class="weui-cell weui-cell_select weui-cell_select-after">
        <div class="weui-cell__hd">
          <label for="" class="weui-label">国家/地区</label>
        </div>
        <div class="weui-cell__bd">
          <select class="weui-select" name="select2">
            <option value="1">中国大陆</option>
            <option value="2">美国</option>
            <option value="3">英国</option>
          </select>
        </div>
      </div>
      <div class="weui-cell weui-cell_select weui-cell_select-before">
        <div class="weui-cell__hd">
          <select class="weui-select" name="select2">
            <option value="1">+86</option>
            <option value="2">+80</option>
            <option value="3">+84</option>
            <option value="4">+87</option>
          </select>
        </div>
        <div class="weui-cell__bd">
          <input class="weui-input telNum" type="number" pattern="[0-9]*">
        </div>
      </div>
    </div>
    <div class="btn_box">
      <a href="javascript:;" class="weui-btn">下一步</a>
    </div>
  </section>
  <script src="script/jquery-2.2.4.js"></script>
  <script src="script/jquery-weui.js"></script>
  <script src="script/js.js?1"></script>
  <script>
    $('.weui-btn').click(function(){
      var phone=$('.telNum').val();
      if(phone!=''){
        if(phone.match(/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/)){
          console.log(phone);
          $.ajax({
            url:ajaxUrl+'/api/Smsapi/send',
            data:{
              phone:phone,
              moban:1
            },
            type:'post',
            dataType:'json',
            success:function(data){
              if(data.code==200){
                window.location='sms-verify.html?phone='+phone+'&id='+GetQueryString('id');
              }else{
                $.alert(data.msg);
              }
            },
            error:function(err){
              $.alert(err.msg);
            }
          })
        }
      }
    })
  </script>
</body>
</html>
